﻿namespace Authentication.Data.DBConfig
{
    using Authentication.Configuration;
    using Authentication.Model.Model;
    using Common.Data.Extensions;
    using System.Data.Entity.ModelConfiguration;

    public class GroupConfiguration : DBConfig<ApplicationGroup>
    {
        public GroupConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(k => new { k.ApplicationKey, k.GroupId });
            Property(c => c.ApplicationKey).HasMaxLength(36).IsRequired();
            Property(c => c.GroupNameEnglish).HasMaxLength(256).IsRequired();
            Property(c => c.GroupNameLocal).HasMaxLength(256);
            Property(c => c.Active).HasMaxLength(1);
        }
    }
}